package com.focusthings.pro.songlibao.profile.profile.api;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.focusthings.pro.songlibao.profile.profile.entity.ProSonglibaoProfile;
import com.focusthings.pro.songlibao.profile.profile.service.IProSonglibaoProfileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
* @Description: 项目-线下宝-用户
* @Author: jeecg-boot
* @Date:   2021-09-15
* @Version: V1.0
*/
@Api(tags="项目-线下宝-用户")
@RestController
@RequestMapping("/profile/proXxbProfileApi")
@Slf4j
public class ProXxbProfileControllerApi extends JeecgController<ProSonglibaoProfile, IProSonglibaoProfileService> {
   @Autowired
   private IProSonglibaoProfileService proSonglibaoProfileService;



   /**
    *   添加
    *
    * @param proXxbProfile
    * @return
    */
   @AutoLog(value = "项目-线下宝-用户-添加")
   @ApiOperation(value="项目-线下宝-用户-添加", notes="项目-线下宝-用户-添加")
   @PostMapping(value = "/add")
   public Result<?> add(@RequestBody ProSonglibaoProfile proXxbProfile) {
       UpdateWrapper all = new UpdateWrapper();
       all.eq("douyin_id",proXxbProfile.getDouyinId());
       proSonglibaoProfileService.saveOrUpdate(proXxbProfile,all);
       return Result.OK("添加成功！");
   }
}
